package com.gaohe.official.service.impl;

import java.util.List;
import com.gaohe.common.core.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.gaohe.official.mapper.FmCommunityTopicMapper;
import com.gaohe.official.domain.FmCommunityTopic;
import com.gaohe.official.service.IFmCommunityTopicService;

/**
 * 圈子栏目Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-06-03
 */
@Service
public class FmCommunityTopicServiceImpl implements IFmCommunityTopicService 
{
    @Autowired
    private FmCommunityTopicMapper fmCommunityTopicMapper;

    /**
     * 查询圈子栏目
     * 
     * @param communityTopicId 圈子栏目主键
     * @return 圈子栏目
     */
    @Override
    public FmCommunityTopic selectFmCommunityTopicByCommunityTopicId(Long communityTopicId)
    {
        return fmCommunityTopicMapper.selectFmCommunityTopicByCommunityTopicId(communityTopicId);
    }

    /**
     * 查询圈子栏目列表
     * 
     * @param fmCommunityTopic 圈子栏目
     * @return 圈子栏目
     */
    @Override
    public List<FmCommunityTopic> selectFmCommunityTopicList(FmCommunityTopic fmCommunityTopic)
    {
        return fmCommunityTopicMapper.selectFmCommunityTopicList(fmCommunityTopic);
    }

    /**
     * 新增圈子栏目
     * 
     * @param fmCommunityTopic 圈子栏目
     * @return 结果
     */
    @Override
    public int insertFmCommunityTopic(FmCommunityTopic fmCommunityTopic)
    {
        fmCommunityTopic.setCreateTime(DateUtils.getNowDate());
        return fmCommunityTopicMapper.insertFmCommunityTopic(fmCommunityTopic);
    }

    /**
     * 修改圈子栏目
     * 
     * @param fmCommunityTopic 圈子栏目
     * @return 结果
     */
    @Override
    public int updateFmCommunityTopic(FmCommunityTopic fmCommunityTopic)
    {
        fmCommunityTopic.setUpdateTime(DateUtils.getNowDate());
        return fmCommunityTopicMapper.updateFmCommunityTopic(fmCommunityTopic);
    }

    /**
     * 批量删除圈子栏目
     * 
     * @param communityTopicIds 需要删除的圈子栏目主键
     * @return 结果
     */
    @Override
    public int deleteFmCommunityTopicByCommunityTopicIds(Long[] communityTopicIds)
    {
        return fmCommunityTopicMapper.deleteFmCommunityTopicByCommunityTopicIds(communityTopicIds);
    }

    /**
     * 删除圈子栏目信息
     * 
     * @param communityTopicId 圈子栏目主键
     * @return 结果
     */
    @Override
    public int deleteFmCommunityTopicByCommunityTopicId(Long communityTopicId)
    {
        return fmCommunityTopicMapper.deleteFmCommunityTopicByCommunityTopicId(communityTopicId);
    }
}
